/*
package com.ruoyi.member.service.impl;

import com.ruoyi.common.config.EmailConfig;
import com.ruoyi.member.service.BindNewEmailService;
import com.ruoyi.member.vo.BindNewEmailRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.mail.SimpleMailMessage;
import org.springframework.mail.javamail.JavaMailSender;
import org.springframework.stereotype.Service;

import java.util.function.BiConsumer;

@Service
public class BindNewEmailServiceImpl implements BindNewEmailService {

    @Autowired
    private EmailConfig emailConfig;

    @Autowired
    private JavaMailSender javaMailSender;

    @Override
    public int sendValidateToMobile(long customerId, String kaptcha, String oldKaptcha, BiConsumer<String, String> consumer) {
        return 0;
    }

    @Override
    public int validateCode(String code, String originCode, String mobile) {
        return 0;
    }

    @Override
    public int checkKaptcha(String kaptcha, String kaptchaInSession) {
        return 0;
    }

    @Override
    public int sendEmail(BindNewEmailRequest newEmail) {
        SimpleMailMessage simpleMailMessage = new SimpleMailMessage();
        //设置发件邮箱
        simpleMailMessage.setFrom(emailConfig.getEmailFrom());
        //收件人邮箱
        simpleMailMessage.setTo(newEmail.getEmail());
        //主题标题
        //simpleMailMessage.setSubject(text);
        //信息内容
        //simpleMailMessage.setText(message);
        //执行发送
        try {//发送可能失败
            //javaMailSender.send(simpleMailMessage);
            //没有异常返回true，表示发送成功
            //return true;
        } catch (Exception e) {
            //发送失败，返回false
            //return false;
        }
        return 0;
    }

    @Override
    public int reSendEmail(long customerId) {
        return 0;
    }

    @Override
    public int modifiedEmail(String checkCodeS, String customerIdS, String finalDateS, String key, long currentCustomerId) {
        return 0;
    }
}*/
